package com.project.mapper;

import com.project.bean.DiscussBean;
import com.project.bean.TopicBean;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDate;
import java.util.List;

@Mapper
public interface ITopicMapper {
    public List<TopicBean> findByChannel(int channelId);

    public List<TopicBean> cutByItem(@Param("channelId") int channelId,
   @Param("topicName") String topicName,@Param("authName") String authName, @Param("startDate") LocalDate startDate,
      @Param("endDate") LocalDate endDate );

    @Insert("insert into t_topic(t_name,t_auth,t_date,fk_channelId)" +
        "values(#{name},#{auth},#{date},#{channelBean.id})")
    public void add(TopicBean topicBean) ;

public TopicBean findById(int id);
}
